// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

TestCase := Window {
   width: 100px;
   height: 100px;
   property<int> niceness: 33;
   greeting := TouchArea {
       clicked => { root.niceness += 1; }
       t:= Text {
           text: "Hello world";
       }

       states [
            rude when root.niceness <= 0: {visible: false;}
            mannered when root.niceness > 100: {t.text: "Hello, dearest world"; t.font-size: 32px;}
       ]
   }

   property <bool> test: greeting.visible;
}


/*
```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
assert(instance.get_test());
slint_testing::send_mouse_click(&instance, 50., 50.);
assert_eq(instance.get_niceness(), 34);

instance.set_niceness(-1);
assert(!instance.get_test());
slint_testing::send_mouse_click(&instance, 50., 50.);
assert_eq(instance.get_niceness(), -1);

```


```rust
let instance = TestCase::new().unwrap();
assert!(instance.get_test());
slint_testing::send_mouse_click(&instance, 50., 50.);
assert_eq!(instance.get_niceness(), 34);

instance.set_niceness(-1);
assert!(!instance.get_test());
slint_testing::send_mouse_click(&instance, 50., 50.);
assert_eq!(instance.get_niceness(), -1);
```


*/
